package com.hzzh.servlet;

import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hzzh.service.MeetingRoomService;
import com.hzzh.vo.MeetingRoom;

/**
 * Servlet implementation class ViewAllMeetingRoomServlet
 */
@WebServlet("/ViewAllMeetingRoomsServlet")
public class ViewAllMeetingRoomsServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ViewAllMeetingRoomsServlet() {
        super();
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request,response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		MeetingRoomService mr = new MeetingRoomService();
		
		List<MeetingRoom> list = mr.viewAllMeetingRooms();
		request.setAttribute("meetingroomsList",list);
		request.getRequestDispatcher("allmeetingrooms.jsp").forward(request, response);
			/*request.setAttribute("meetingroomsList",al);
			request.getRequestDispatcher("allmeetingrooms.jsp").forward(request, response);*/
		
		
	}

}
